#!C:\Python26
# -*- coding: UTF-8 -*-

import queVars
import time

def printFuncDef(inStr):
	print inStr,

queVars.printFunc = printFuncDef

import imp
import os.path

f, filename, desc = imp.find_module('HFscrape', ['Plugins'])
DAScrape = imp.load_module("HFscrape", f, filename, desc)		#Messy hack to do relative imports

import webFunctions



import logmanager

logmanager.initLogging()

scr = DAScrape.getHF()




if scr.retrievalHandles > 1:
	print "Retrieval Handles - ", scr.retrievalHandles
	handle = []
	for x in range(scr.retrievalHandles):
		handle.append(webFunctions.WebGetRobust())

elif scr.retrievalHandles == 1:

	handle = webFunctions.WebGetRobust()


scr.config = queVars.ConfigValues()
scr.config.ovwMode = "Overwrite Files"

scr.config.aList = ["bololo"]
name = scr.config.aList[0]
link = "http://www.hentai-foundry.com/pic-100684.html"

scr.DLFolder = os.path.join(scr.config.settings.downloadDir, scr.DLFolder)
print scr.getpic(link, handle, name)


#x = scr.main(scr.config, handle)


